package com.zhuidian.mothernote.activity;

import android.annotation.SuppressLint;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.base.decoration.LinearLayoutDecoration;
import com.base.listener.ItemClickListener;
import com.base.presenter.BasePresenter;
import com.zhuidian.mothernote.R;
import com.zhuidian.mothernote.adapter.RedDevelopsDetailAdapter;
import com.zhuidian.mothernote.global.BaseActivity;

public class RedDevelopsDetailActivity extends BaseActivity {
    private RelativeLayout ll_title;
    private ImageView iv_arrow;
    private TextView tv_get_red_develops;
    private RecyclerView recyclerView;
    private RedDevelopsDetailAdapter adapter;

    @Override
    protected int inflateMainLayoutId() {
        return R.layout.activity_red_develops_detail;
    }

    @SuppressLint("WrongConstant")
    @Override
    protected void initView(View view) {
        setTopGone();
        ll_title = (RelativeLayout) view.findViewById(R.id.ll_title);
        iv_arrow = (ImageView) view.findViewById(R.id.iv_arrow);
        tv_get_red_develops = (TextView) view.findViewById(R.id.tv_get_red_develops);
        recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
        recyclerView.setHasFixedSize(true);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.addItemDecoration(new LinearLayoutDecoration(context));
        adapter = new RedDevelopsDetailAdapter(context);
        adapter.setOnClickListener(this);
        adapter.setItemClickListener(new ItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {

            }
        });
        recyclerView.setAdapter(adapter);

    }

    @Override
    protected void setListener() {
        iv_arrow.setOnClickListener(this);
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        switch (view.getId()) {
            case R.id.iv_arrow:
                onBackPressed();
                break;
        }
    }
}
